/**
 * 
 */
package com.dashboard.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dashboard.dao.MovieDao;
import com.dashboard.domain.Movie;

/**
 * @author Joao
 * 
 */
@Service
public class MovieServiceImpl implements MovieService
{

	private MovieDao movieDao;

	/**
	 * 
	 * @param movieDao df
	 */
	@Autowired
	public MovieServiceImpl(MovieDao movieDao)
	{
		this.movieDao = movieDao;
	}

	/**
	 * @param movie sdf
	 */
	@Transactional
	public void createNew(Movie movie)
	{
		movieDao.persistir(movie);
	}

	/**
	 * @return kyhg
	 */
	public List<Movie> findAll()
	{
		return movieDao.recuperarTodos();
	}

	/**
	 * @param title hkg
	 * @return sdf
	 */
	public List<Movie> findByTitle(String title)
	{
		return movieDao.findByTitle(title);
	}
}
